var __extends =
    (this && this.__extends) ||
    (function () {
      var t = function (o, e) {
        return (t =
          Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array &&
            function (t, o) {
              t.__proto__ = o;
            }) ||
          function (t, o) {
            for (var e in o)
              Object.prototype.hasOwnProperty.call(o, e) && (t[e] = o[e]);
          })(o, e);
      };
      return function (o, e) {
        function n() {
          this.constructor = o;
        }
        if ("function" != typeof e && null !== e)
          throw new TypeError(
            "Class extends value " + String(e) + " is not a constructor or null"
          );
        t(o, e),
          (o.prototype =
            null === e
              ? Object.create(e)
              : ((n.prototype = e.prototype), new n()));
      };
    })(),
  AutoStopView = (function (t) {
    function o() {
      var o = t.call(this) || this;
      return o.btn_auto_stop.on(Laya.Event.CLICK, o, o.onAutoStopAction), o;
    }
    return (
      __extends(o, t),
      (o.show = function (t, e, n) {
        return (
          this.autoV || (this.autoV = new o()),
          (this.autoV.label_auto_rest.text = "还剩" + t + "次"),
          (this.autoV.caller = e),
          (this.autoV.method = n),
          this.autoV
        );
      }),
      (o.hide = function () {
        this.autoV && this.autoV.removeSelf();
      }),
      (o.prototype.onAutoStopAction = function () {
        this.method.call(this.caller),
          Laya.stage.event("HomePageView", {
            code: "setAutoFight",
            isAuto: !1,
          }),
          Laya.stage.event("GameMainView", {
            code: "setAutoFight",
            isAuto: !1,
          }),
          localStorage.setItem("startAuto", "");
      }),
      o
    );
  })(ui.Settings.AutoStopViewUI);
